#include "logindialog.h"
#include "ui_logindialog.h"
#include <QMessageBox>
#include "maindialog.h"

LoginDialog::LoginDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::LoginDialog)
{
    ui->setupUi(this);
}

LoginDialog::~LoginDialog()
{
    delete ui;
}

void LoginDialog::on_btnLogin_clicked()
{
    QString userName = ui->edtUserName->text();
    QString userPass = ui->edtUserPass->text();

    if(userName == "lijing" && userPass == "lijing666")
    {
        this->close();
        MainDialog dlg;
        dlg.exec();
    }
    else
    {
        QMessageBox::critical(this, "温馨提示", "您的用户名或密码错误，请重新输入！");
    }
}
